package com.example.practice.dao;

import com.example.practice.entity.Activity;
import com.example.practice.entity.Rule;
import com.example.practice.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.data.domain.Pageable;
import java.util.List;

/**
 * (Activity)表数据库访问层
 *
 * @author makejava
 * @since 2023-12-21 10:00:20
 */
@Mapper
public interface ActivityDao {

    List<Activity> getJoinActivity(@Param("uid") Integer uid);
    List<Activity> getNotJoinActivity(@Param("uid") Integer uid);
    Integer createActivity(@Param("uid") Integer uid,@Param("activity") Activity activity);

    List<Activity> getReleaseActivity(@Param("uid") Integer uid);

    Integer updateActivity(@Param("activity")Activity activity);

    Integer studentJoin(@Param("uid")Integer uid,@Param("aid")Integer aid);
//学生老师都加入
    Integer activityRelease(@Param("rule")Rule rule,@Param("sid") Integer sid);
//只有老师
    Integer activityRelease1(@Param("rule")Rule rule,@Param("sid") Integer sid);
    //只有学生
    Integer activityRelease2(@Param("rule")Rule rule,@Param("sid") Integer sid);

    Integer queryIfJoin(@Param("uid")Integer uid,@Param("aid") Integer aid);

    Integer ExitActivity(@Param("uid") Integer uid,@Param("aid")Integer aid);
    Activity getDetail(@Param("aid")Integer aid);
    Integer queryIfRelease(@Param("aid")Integer aid);

    Integer updateActivityStatus(@Param("aid")Integer aid);

    Integer updateActivityStatus1(@Param("aid")Integer aid);
    Integer deleteActivity(@Param("aid")Integer aid);

    Integer addNum(@Param("aid")Integer aid);
    Integer subNum(@Param("aid")Integer aid);

    Integer queryCheckStatus(@Param("uid")Integer uid,@Param("aid")Integer aid);
    Activity queryByaid(@Param("aid")Integer aid, @Param("uid")Integer uid);

    Activity queryByName(@Param("name")String name, @Param("uid")Integer uid);
    Activity queryIdByName(@Param("name")String name);
    Integer updateActivityStatus2(@Param("aid")Integer aid);
    Activity getActivityById(@Param("id")Integer id);

    List<Activity> getAllByUid(@Param("uid")Integer uid);

    Activity getAct(@Param("fid")Integer fid);

    List<Activity> getAllAct();
    List<Activity> getActivityByUid(@Param("uid")Integer uid);

    List<Activity> getDistName();

    String getByAid(@Param("aid")Integer aid);
    Integer insertActivityAndSchool(@Param("uid")Integer uid,@Param("sName")List<String> sName,@Param("aid")Integer aid);

    Rule getActRuleByAid(@Param("aid")Integer aid);

    List<User> getUserNum(@Param("aid")Integer aid);

    List<Activity> getAllActivity();
}

